package cn.source.system.service.impl;

import cn.source.common.utils.DateUtils;
import cn.source.system.domain.DeyuArticle;
import cn.source.system.mapper.DeyuArticleMapper;
import cn.source.system.service.IDeyuArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资讯信息Service业务层处理
 * 
 * @author deyucare.com
 * @date 2025-02-20
 */
@Service
public class DeyuArticleServiceImpl implements IDeyuArticleService 
{
    @Autowired
    private DeyuArticleMapper deyuArticleMapper;

    /**
     * 查询资讯信息
     * 
     * @param id 资讯信息主键
     * @return 资讯信息
     */
    @Override
    public DeyuArticle selectDeyuArticleById(Long id)
    {
        return deyuArticleMapper.selectDeyuArticleById(id);
    }

    /**
     * 查询资讯信息列表
     * 
     * @param deyuArticle 资讯信息
     * @return 资讯信息
     */
    @Override
    public List<DeyuArticle> selectDeyuArticleList(DeyuArticle deyuArticle)
    {
        return deyuArticleMapper.selectDeyuArticleList(deyuArticle);
    }

    /**
     * 新增资讯信息
     * 
     * @param deyuArticle 资讯信息
     * @return 结果
     */
    @Override
    public int insertDeyuArticle(DeyuArticle deyuArticle)
    {
        deyuArticle.setCreateTime(DateUtils.getNowDate());
        return deyuArticleMapper.insertDeyuArticle(deyuArticle);
    }

    /**
     * 修改资讯信息
     * 
     * @param deyuArticle 资讯信息
     * @return 结果
     */
    @Override
    public int updateDeyuArticle(DeyuArticle deyuArticle)
    {
        deyuArticle.setUpdateTime(DateUtils.getNowDate());
        return deyuArticleMapper.updateDeyuArticle(deyuArticle);
    }

    /**
     * 批量删除资讯信息
     * 
     * @param ids 需要删除的资讯信息主键
     * @return 结果
     */
    @Override
    public int deleteDeyuArticleByIds(Long[] ids)
    {
        return deyuArticleMapper.deleteDeyuArticleByIds(ids);
    }

    /**
     * 删除资讯信息信息
     * 
     * @param id 资讯信息主键
     * @return 结果
     */
    @Override
    public int deleteDeyuArticleById(Long id)
    {
        return deyuArticleMapper.deleteDeyuArticleById(id);
    }
}
